package org.domain.pseample.session;

import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipSession;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Scope;
import org.mobicents.mscontrol.MsConnection;
import org.mobicents.mscontrol.MsEndpoint;
import org.mobicents.mscontrol.MsLink;

import org.jboss.seam.annotations.Name;

@Name("mapInstance")
@Scope(ScopeType.STATELESS)
public class MapInstance {

	private MsConnection msConnection;
	private MsLink msLink;
	private String sipUri;
	private String userName;
	private SipServletRequest initialRequest;
	private boolean muted;
	private boolean mediaConnected;
	private String statusMessage;
	private boolean caller;
	private boolean callee;
	private boolean conferenceAdmin;
	private String confereceEndpoint;
	//private PushServerMessage pushServerMessage;

	MapInstance() {

	}

	public MsConnection getMsConnection() {
		return msConnection;
	}

	public void setMsConnection(MsConnection msConnection) {
		this.msConnection = msConnection;
	}

	public MsLink getMsLink() {
		return msLink;

	}

	public void setMsLink(MsLink msLink) {
		this.msLink = msLink;
	}

	public String getSipUri() {
		return sipUri;
	}

	public void setSipUri(String sipUri) {
		this.sipUri = sipUri;
	}

	public String getUserName() {
		return userName;

	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public SipServletRequest getInitialRequest() {
		return initialRequest;
	}

	public void setInitialRequest(SipServletRequest initialRequest) {
		this.initialRequest = initialRequest;
	}

	public MsEndpoint getPREndpoint() {
		if (msConnection != null) {
			return msConnection.getEndpoint();
		}
		return null;

	}

	public SipSession getSipSession() {
		if (initialRequest != null)
			return initialRequest.getSession();
		return null;
	}

	public boolean isMuted() {
		return muted;
	}

	public void setMuted(boolean muted) {
		this.muted = muted;
	}

	public boolean isMediaConnected() {
		return mediaConnected;
	}

	public void setMediaConnected(boolean mediaConnected) {
		this.mediaConnected = mediaConnected;

	}

	public String getStatusMessage() {
		return statusMessage;
	}

	public void setStatusMessage(String statusMessage) {
		this.statusMessage = statusMessage;
	}

	public boolean isCaller() {
		return caller;
	}

	public void setCaller(boolean caller) {
		this.caller = caller;
	}

	public boolean isCallee() {
		return callee;
	}

	public void setCallee(boolean callee) {
		this.callee = callee;
	}

	public boolean isConferenceAdmin() {
		return conferenceAdmin;
	}

	public void setConferenceAdmin(boolean conferenceAdmin) {
		this.conferenceAdmin = conferenceAdmin;
	}

	/*public PushServerMessage getPushServerMessage() {
		return pushServerMessage;
	}

	public void setPushServerMessage(PushServerMessage pushServerMessage) {
		this.pushServerMessage = pushServerMessage;
	}*/
}
